<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="/css/main.css">
    <link rel="stylesheet" href="/css/font-awesome/css/font-awesome.css">
</head>
<body>
<div class="box">
    <h3>租赁合同管理</h3>
    <div class="actions">
        <div>
            <a class="btn btn-primary" href="/contract/toAdd">添加合同信息</a>
        </div>
    </div>

    <table class="list">
        <tr>
            <th>租户名</th>
            <th>房屋地址</th>
            <th>租住月数</th>
            <th>房租总额</th>
            <th>合同签署人</th>
            <th>签订状态</th>
            <th>签订日期</th>
            <th>操作</th>
        </tr>
        <c:forEach items="${lcs.list}" var="lcs">
            <tr>
                <td>${lcs.l_name}</td>
                <td>${lcs.h_address}</td>
                <td>${lcs.lc_month}个月</td>
                <td>${lcs.lc_total_rent}</td>
                <td>${lcs.lc_contract_signer}</td>
                <td>${lcs.lc_contract_state=="1"?"已失效":"已生效"}</td>
                <td>${lcs.lc_contract_start_date}</td>
                <td>
                    <a class="fa fa-info" title="详情" href="/contract/detail?id=${lcs.lc_id}"></a>
                    &nbsp;&nbsp;
                    <a class="fa fa-pencil" title="编辑" href="/contract/toEdit?id=${lcs.lc_id }"></a>
                    &nbsp;&nbsp;
                    <a class="fa fa-remove" title="删除" href="/contract/del?id=${lcs.lc_id }" onclick="confirmDelete(1)"></a>
                </td>
            </tr>
        </c:forEach>
    </table>
    <div class="pager-info">
        <div>共有 ${lcs.total} 条记录，第 ${lcs.pageNum }/${lcs.pages} 页 </div>
        <div>
            <ul class="pagination">
                <li class="paginate_button previous disabled }">
                    <c:if test="${lcs.hasPreviousPage}">
                        <a href="/contract/list?currentPage=${lcs.prePage}">上一页</a>
                    </c:if>
                </li>
                <li class="paginate_button active"><a href="#">${lcs.pageNum}</a></li>
                <li class="paginate_button next disabled">
                    <c:if test="${lcs.hasNextPage}">
                        <a href="/contract/list?currentPage=${lcs.nextPage}">下一页</a>
                    </c:if>
                </li>
            </ul>
        </div>
    </div>
</div>
<script src="js/jQuery.js"></script>
<script>
    function confirmDelete(id){
        if (confirm("确定要删除码？")) {
        }
        return false;
    }
</script>
</body>
</html>